package com.rd.student.jike.class2.lihongming.week731_806.Day0802;

import java.io.IOException;
import java.io.RandomAccessFile;

/**
 * @Auther:Heinrich
 * @Date:2023/8/2-08-02-20:51
 * @Description:com.rd.student.jike.class2.lihongming.Day0802
 * @version:1.0
 */

//一个非正常做法
public class Question5 {
    public static void main(String[] args) throws IOException {
        RandomAccessFile file = new RandomAccessFile("./src/com/rd/student/jike/class2/lihongming/Solutions5/A.txt", "rw");
        byte[] pipe = new byte[(int) file.length()];
        file.read(pipe);
        int i = 0, j = pipe.length - 1;
        byte k;
        while (i < j) {
            k = pipe[i];
            pipe[i] = pipe[j];
            pipe[j] = k;
            i++;
            j--;
        }
        String str = new String(pipe);
        System.out.println(str);
    }
}
